package edu.ustb.efws.pipeline.domain;

import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;

import java.util.Date;
import java.util.Objects;
import java.util.StringJoiner;

/**
 * 日志表操作日志
 *
 * @author TS Group
 */
public class TableOpt {
    @ApiModelProperty("编号")
    private Long id;
    @ApiModelProperty("表名")
    private String tableName;
    @ApiModelProperty("月份")
    private Integer month;
    @ApiModelProperty("分区名称")
    private String partition;
    @ApiModelProperty("是否删除")
    private Boolean drop;
    @ApiModelProperty("备注")
    private String remark;
    @ApiModelProperty("创建时间")
    private Date createTime;
    @ApiModelProperty("删除时间")
    private Date dropTime;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public Integer getMonth() {
        return month;
    }

    public void setMonth(Integer month) {
        this.month = month;
    }

    public String getPartition() {
        return partition;
    }

    public void setPartition(String partition) {
        this.partition = partition;
    }

    public Boolean getDrop() {
        return drop;
    }

    public void setDrop(Boolean drop) {
        this.drop = drop;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getDropTime() {
        return dropTime;
    }

    public void setDropTime(Date dropTime) {
        this.dropTime = dropTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TableOpt tableOpt = (TableOpt) o;
        return Objects.equals(id, tableOpt.id) &&
                Objects.equals(tableName, tableOpt.tableName) &&
                Objects.equals(month, tableOpt.month) &&
                Objects.equals(partition, tableOpt.partition) &&
                Objects.equals(drop, tableOpt.drop) &&
                Objects.equals(remark, tableOpt.remark) &&
                Objects.equals(createTime, tableOpt.createTime) &&
                Objects.equals(dropTime, tableOpt.dropTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, tableName, month, partition, drop, remark, createTime, dropTime);
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this)
                .append("id", id)
                .append("tableName", tableName)
                .append("month", month)
                .append("partition", partition)
                .append("drop", drop)
                .append("remark", remark)
                .append("createTime", createTime)
                .append("dropTime", dropTime)
                .toString();
    }
}
